#coding=utf-8

"""
                    str(item['q_name']),
                    str(item['q_IDValue']),
                    str(item['result_value']),
                    str(item['q_question_correct']),
                    str(item['q_question_correct_name']),
                    str(item['question_type']),
"""
from huayiQDB.items import Quest_infoItem,Quest_listItem
import huayiQDB.controller.log as log
logger = log.logger

def changeItem(list_NSinfo,Course_Info, Study_Info,list):
    Q_list = []
    for oneline in list:
        Q = Quest_infoItem()
        Q['q_name'] = oneline['q_name']
        Q['q_IDValue'] = oneline['q_IDValue']
        Q['result_value'] = oneline['result_value']
        Q['q_question_correct'] = oneline['q_question_correct']
        Q['q_question_correct_name'] = oneline['q_question_correct_name']
        Q['question_type'] = oneline['question_type']
        Q['Item_Value'] = list_NSinfo['Item_Value']
        Q['Item_Name'] = list_NSinfo['Item_Name']
        Q['Course_Value'] = Course_Info['Course_Value']
        Q['Course_Name'] = Course_Info['Course_Name']
        Q['Study_Name'] = Study_Info['Study_Name']
        Q['Study_Value'] = Study_Info['Study_Value']
        Q['Course_score'] = Course_Info['Course_score']
        Q['Class_Type'] = list_NSinfo['Class_Type']
        Q['a_name_all'] = oneline['a_name_all']
        Q_list.append(Q)
    return Q_list

def yieldAllItem(list):
    for oneline in list:
        yield oneline

